package com.baizhi.service;

import com.baizhi.dao.UserDAO;
import com.baizhi.dao.UserDAOImpl;
import com.baizhi.entity.User;

import java.util.List;


public class UserServiceImpl implements UserService {
    private UserDAO ud = new UserDAOImpl();
    @Override
    public User login(String account, String password) {
        User user = ud.queryByUserAndPassword(account,password);
        return user;
    }

    @Override
    public void save(User user) {
        ud.register(user);
    }

    @Override
    public List<User> showAll() {
        return ud.queryAll();
    }


    @Override
    public User show(User user){
        return ud.ShowFansNumberAndIntroduce(user);
    }
}
